//
//  SearchViewController.h
//  vietnameseSlang
//
//  Created by Jason Bargent on 22/09/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "ASIHTTPRequest.h"
#import "JMLoadingView.h"
#import <UIKit/UIKit.h>

#define FORM_LABEL_WIDTH 110
#define FORM_LABEL_HEIGHT 25
#define FORM_FIELD_WIDTH 135
#define FORM_FIELD_HEIGHT 25
#define FORM_BUTTON_WIDTH 130
#define FORM_BUTTON_HEIGHT 40

#define FORM_TEXTFIELD_HEIGHT 44
#define FORM_CELL_PADDING_LARGE 20
#define UITABLEVIEW_GROUPED_PADDING 8
#define UI_FONT_SIZE_16 15

#define DATE_FORMAT_STRING @"YYYY-MM-dd"

@interface SearchViewController : UIViewController<UITableViewDelegate, UITableViewDataSource,
UITextFieldDelegate> {
	NSMutableArray* words;
    
    UITextField * keywordTextField;
	UIButton * searchButton;
    UITableView * tableView;
    BOOL isTheViewActive;
    UIView * theView;
    CGPoint svos; //hold the last content offset of scrollview
    
    JMLoadingView * loadingView;
}

@property (nonatomic, retain) NSMutableArray* words;

@property (nonatomic, retain) JMLoadingView * loadingView;

@property (assign) CGPoint svos;
@property (assign) BOOL isTheViewActive;
@property (nonatomic, retain) UITextField * keywordTextField;
@property (nonatomic, retain) UIButton * searchButton;
@property (nonatomic, retain) UITableView * tableView;
@property (nonatomic, retain) UIView * theView;

- (void) reset;
- (id)initWithTabBar;
- (void) dismissTheView;

- (void) sendRequest;
- (void)syncRequestFailed:(ASIHTTPRequest *)request;
- (void)syncRequestFinished:(ASIHTTPRequest *)request;
- (void) synchronousRequest:(ASIHTTPRequest *)searchRequest;

@end
